1. Field of the Invention
The present invention relates to a task scheduling method in the case of carrying out the simultaneous transfer of compressed audio/video data and non-compressed audio/video data between the host system and the data encoding/decoding apparatus.
2. Description of the Related Art
In the conventional system, when the compressed audio/video data, which is created by the compression coding, and the non-compressed audio/video data which is the data before the compression coding or the de-multiplexed and decoded data, are simultaneously transferred between the host system (PC etc.) and the data encoding/decoding apparatus (MPEG2 PS/TS CODEC etc.), the following four kinds of transfer tasks may be performed simultaneously.
1) The non-compressed video data is transferred from the data encoding/decoding apparatus to the buffer in the main memory of the host system through the bus, such as USB (universal serial bus).
2) The non-compressed audio data is transferred from the data encoding/decoding apparatus to the buffer in the main memory of the host system through the bus, such as USB.
3) The compressed audio/video data (AV stream) is transferred from the data encoding/decoding apparatus to the buffer in the main memory of the host system through the bus, such as USB.
4) The compressed audio/video data is transferred from the buffer in the main memory of the host system to the data encoding/decoding apparatus through the bus, such as USB.
Each transfer task uses the separate end point on the bus, such as USB, and is performed through the bulk transfer, the interrupt transfer or the isochronous transfer.
In the conventional system mentioned above, the operation of the data encoding/decoding apparatus is controlled as follows.
The USB host system outputs the control command of the user definition to the USB device controller using the bulk transfer or the control transfer.
If this control command is received, the USB device controller will control the ASIC circuit, the MPEG2 CODEC, the video encoder/decoder, the audio ADC/DAC, etc. according to the received control command, respectively.
In the following, the compressed audio/video data will be referred to as the compressed data, and the non-compressed audio/video data will be referred to as the non-compressed data, for the sake of convenience of description.
In the above-mentioned conventional system, if the load of the CPU on the host system increases, in the case of simultaneously transferring the compressed data and the non-compressed data between the host system and the data encoding/decoding apparatus, the transfer rate from the buffer of the host system to the exterior may fall, or the transfer rate on the bus, such as USB, may fall.
Thus, if the transfer rate falls excessively, there may be the problem that the buffer on the side of the host system or the buffer on the side of the data encoding/decoding apparatus is subjected to overflowing, and transferring all the information that should be transferred is impossible.
The transferring of the compressed data is mainly aimed at recording the compressed data in the HDD, etc., and decoding it repeatedly for viewing and listening later, and the transferring of the non-compressed data is mainly aimed at viewing and listening in real time.
For this reason, if the load of the CPU on the host system increases significantly to cause the overflowing of the buffer and the loss of the data, the images or voice which the user views and listens in real time are temporarily interrupted with respect to the non-compressed data. Moreover, with respect to the compressed data, the data which should be recorded in the HDD etc. is lost in such a case.
It is the ideal that all the data is not lost. However, in a case where avoiding the problem is difficult in view of the capacity of the system, priority should be given to recording the compressed data in the HDD etc. correctly even if interruption of viewing and listening in real time occurs temporarily.